<?php

namespace App\User;

use Illuminate\Database\Eloquent\Model;

class Question extends Model
{
    protected $table = 'question';


    public function getTypeNameAttribute()
    {
        return $this->type === 1 ? '单选题' : ($this->type === 2 ? '多选题' : '判断题');
    }

    public function getSelectArrayAttribute()
    {
        return explode('.##XD', $this->select);
    }

    public function getSelectAnswerAttribute()
    {
        return explode('.##XD', $this->select);
    }

}
